package o2o.dao.PO.event;

import java.util.HashSet;
import java.util.Set;

public class EventInfo {

    // 执行状态
    public static final Integer EXEC_STATE_FAIL = -1;   // 执行失败
    public static final Integer EXEC_STATE_ING = 0;     // 执行中
    public static final Integer EXEC_STATE_SUCCESS = 1; // 执行成功
    // 事件类型
    public static final String EVENT_TYPE_SEND_SHOP = "registerOrUpdateShop";       // 注册或更新门店
    public static final String EVENT_TYPE_SUB_DELIVERY_ORDER = "submitDeliveryOrder";  // 下配送单
    public static final String EVENT_TYPE_CANCEL_DELIVERY_ORDER = "cancelDeliveryOrder";   // 取消配送单

    public static Set<String> eventTypeSet = new HashSet<>();

    static {
        eventTypeSet.add(EVENT_TYPE_SEND_SHOP);
        eventTypeSet.add(EVENT_TYPE_SUB_DELIVERY_ORDER);
        eventTypeSet.add(EVENT_TYPE_CANCEL_DELIVERY_ORDER);
    }


    private Long id;                // id
    private String sysAppKey;       // 系统标识
    private String eventType;       // 事件类型
    private String params;          // 方法入参->传递的参数
    private int execCount = 0;      // 执行次数
    private int execState = 0;      // 是否执行了
    private Long execTime;          // 执行时间
    private String note;            // 备注
    private int delFlag = 0;        // 是否删除
    private String createUser;      // 创建者
    private Long createTime;        // 创建时间
    private String updateUser;      // 更新者
    private Long updateTime;        // 更新时间


    public Long getId() {
        return id;
    }

    public EventInfo setId(Long id) {
        this.id = id;
        return this;
    }

    public String getSysAppKey() {
        return sysAppKey;
    }

    public EventInfo setSysAppKey(String sysAppKey) {
        this.sysAppKey = sysAppKey;
        return this;
    }

    public String getEventType() {
        return eventType;
    }

    public EventInfo setEventType(String eventType) {
        this.eventType = eventType;
        return this;
    }

    public String getParams() {
        return params;
    }

    public EventInfo setParams(String params) {
        this.params = params;
        return this;
    }

    public int getExecCount() {
        return execCount;
    }

    public EventInfo setExecCount(int execCount) {
        this.execCount = execCount;
        return this;
    }

    public int getExecState() {
        return execState;
    }

    public EventInfo setExecState(int execState) {
        this.execState = execState;
        return this;
    }

    public Long getExecTime() {
        return execTime;
    }

    public EventInfo setExecTime(Long execTime) {
        this.execTime = execTime;
        return this;
    }

    public String getNote() {
        return note;
    }

    public EventInfo setNote(String note) {
        this.note = note;
        return this;
    }

    public int getDelFlag() {
        return delFlag;
    }

    public EventInfo setDelFlag(int delFlag) {
        this.delFlag = delFlag;
        return this;
    }

    public String getCreateUser() {
        return createUser;
    }

    public EventInfo setCreateUser(String createUser) {
        this.createUser = createUser;
        return this;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public EventInfo setCreateTime(Long createTime) {
        this.createTime = createTime;
        return this;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public EventInfo setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
        return this;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public EventInfo setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
        return this;
    }
}
